package com.xuanyuanxinyu.compose.ui.other

import android.provider.MediaStore.Audio.Artists
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.xuanyuanxinyu.compose.theme.AppTheme

/**
 * @FileName:
 * @Description:
 * @author ken.luo
 * @date 2023/4/4
 * @version V1.0
 * @email 424533553@qq.com
 */
@Composable
fun ArtistCardModifiers(artist : Artists? = null,onClick : () -> Unit) {
    val padding = 16.dp
    Column(
        Modifier
            //设置点击事件
            .clickable(onClick = onClick)
            //设置paddding
            .padding(padding)
            .size(width = 300.dp,height = 400.dp)
            .fillMaxWidth()) {
        Row(verticalAlignment = Alignment.CenterVertically) { /*...*/
            Icon(Icons.Filled.Check,contentDescription = "Check mark")
        }
        //指定空隙大小
        Spacer(Modifier.size(padding))
        Card(elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)) { /*...*/
            Text("Hello")
        }
    }
}

@Preview(showBackground = true)
@Composable
fun PreviewArtistCardModifiers() {
    AppTheme {
        ArtistCardModifiers(null) {
            print("点击事件")
        }
    }
}
